Skip to main content
Version: 1.2.2

Media Service API

Media Service API Documentation

Version: 1.2.2

Paths

Healthcheck API

/media-services/api/v1/healthz/

  • Method: GET
  • Summary: Health Check
  • Description: Return Health Status.
  • Responses:
    • 200:
      • Description: Successful Response
      • Content-Type: application/json

Media Service Generation API

/media-services/api/v1/

  • Method: POST
  • Summary: Generate Media Service for single file
  • Description: Generate transcription, description, metadata and thumbnail for a single media file (audio/video).

Request Payload:

TypeParameterDescriptionData TypeIs Optional
Form Datachoice_model_selectionAI model selection (whisper)StringNo
Form Datamedia_typeSelect the type of uploaded file (audio/video)StringNo
Form Datainput_mediaUpload a single audio/video fileFile (.mp3, .mp4, .mpeg, .wav, .webm)No
Form DatadescriptionEnable detailed description generationbooleanYes
Form Datadescription_lengthDesired length of generated description (25-500)integerYes
Form DatametadataEnable metadata generationbooleanYes
Form DatathumbnailEnable thumbnail generation (only supported for video files)booleanYes

Sample Code :

import requests

url = "https://api-genai-dev.learningmate.co/media-services/api/v1/"
file_path = "your file path here"
token = "your token here"

headers = {
"accept": "application/json",
"Authorization": f"Bearer {token}",
}

data = {
"choice_model_selection": "whisper",
"media_type": "audio",
"description": "true",
"description_length": "225",
"metadata": "true",
"thumbnail": "false",
}

files = {
"input_media": (file_path, open(file_path, "rb"), "audio/wav"),
}

response = requests.post(url, headers=headers, data=data, files=files)

Example Response:

{
"status_code": 200,
"message": "SUCCESS::MediaService generated successfully",
"file_name": "Your filename will appear here",
"transcription": "Transcription will appear here",
"description_text": "Description will appear here",
"metadata_output": {
"title": "Title will appear here",
"description": "Description will appear here",
"genre": ["Genre will appear here"],
"creator": "Creator will appear here",
"keywords": ["Keywords will appear here"],
"custom": "custom will appear here"
},
"thumbnail_output": "Thumbnail will appear here"
}

Responses:

Status CodeDescriptionContent-Type
200Successful Responseapplication/json
201Successful Creationapplication/json
400Bad Requestapplication/json
413Request Entity Too Largeapplication/json
415Unsupported Media Typeapplication/json
422Unprocessable Entityapplication/json
500Internal Server Errorapplication/json